<template>
	<view>
		<!-- 导航栏 -->
		<view class="nav">
			<view class="nav-item" @click="navLeft">
				<text :class="[lineChecked?'active':'']">精选文章</text>
			</view>
			<view class="nav-item" @click="navRight">
				<text :class="[lineChecked?'':'active']">品牌列表</text>
			</view>
		</view>
		
		
		<!-- 精选文章内容 -->
		<view class="choicText" v-if="lineChecked">
			<image src="https://bufan-apitown.oss-cn-beijing.aliyuncs.com/bftec/20201222161432458timg.jfif" mode=""></image>
			<view class="choicDown">
				<view class="choicDownLeft">
					<image src="../../static/icons/view.png" mode=""></image>
					<text class="">26</text>
				</view>
				<view class="choicDownRight">
					<image src="../../static/icons/collect1.png" mode=""></image>
				</view>
			</view>
		</view>
		
		
		<view class="choicText" v-if="lineChecked">
			<image src="https://bufan-apitown.oss-cn-beijing.aliyuncs.com/bftec/202012092102468971.jpg" mode=""></image>
			<view class="choicDown">
				<view class="choicDownLeft">
					<image src="../../static/icons/view.png" mode=""></image>
					<text class="">56</text>
				</view>
				<view class="choicDownRight">
					<image src="../../static/icons/collect1.png" mode=""></image>
				</view>
			</view>
		</view>
		
		
		
		
		
		<!-- 品牌列表内容 -->
		<view class="braList" v-for="item in list" v-if="lineChecked==false">
			<image :src="item.bigPic" mode=""></image>
			<view class="braListName">{{item.name}}</view>
			<view class="barListCon">{{item.brandStory}}</view>
		</view>
		
		
		
		
		
		
		
		
		
	</view>
</template>

<script>
	import {findBrandsByPage} from "../../api/find/index.js"
	export default {
		data() {
			return {
				lineChecked:true,
				list:[],
			};
		},
		onLoad(){
			findBrandsByPage().then(res=>{
				console.log(res)
				this.list=res.data.rows
			})
		},
		methods:{
			navLeft(){
				this.lineChecked=true;
			},
			navRight(){
				this.lineChecked=false;
			}
		}
		
	}
</script>


<style lang="scss">
	page {
		background-color: #F1ECE7;
	}
</style>
<style lang="scss">
	// 头部导航
	.nav{
		width: 100%;
		height: 44px;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: rgb(53, 78, 68);
		.nav-item{
			color: #fff;
			width: 74px;
			text-align: center;
			text{
				padding-bottom: 5px;
			}
		}
	}
	.active{
		border-bottom: 1px solid #fff;
	}
	// 精选文章
	.choicText{
		width: 337px;
		height: 241px;
		position: relative;
		display: flex;
		margin: 0 auto;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background-color: #fff;
		image{
			width: 100%;
			height: 191px;
			border-radius: 12px 12px 0 0;
		}
		margin: 14px 19px;
		border-radius: 12px;
		.choicDown{
			width: 277px;
			height: 50px;
			padding: 0 30px;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.choicDownLeft{
				image{
					width: 30px;
					height: 20px;
					margin-right: 15px;
					margin-top: 15px;
				}
				text{
					line-height: 50px;
				}
			}
			.choicDownRight{
				image{
					width: 20px;
					height: 20px;
				}
			}
		}
	}
	//品牌列表
	.braList{
		width: 345px;
		height: 311px;
		margin: 0 auto;
		background-color: #fff;
		margin: 15px;
		image{
			width: 100%;
			height: 240px;
		}
		.braListName{
			font-size: 16px;
			line-height: 22px;
			color: #3e3e3e;
			font-weight: bold;
			margin-top: 15px;
			margin-left: 15px;
		}
		.barListCon{
			font-size: 11px;
			color: #b1b1b1;
			line-height: 15px;
			white-space: nowrap;
			overflow: hidden;
			margin-left: 15px;
		}
	}


</style>
